#ifndef KUGOUAPP_H
#define KUGOUAPP_H

#include <QWidget>
#include<memory>
#include<QMap>
#include<QUrl>

QT_BEGIN_NAMESPACE
namespace Ui {
class KuGouApp;
}
QT_END_NAMESPACE

class QMediaPlayer;
class QAudioOutput;

class KuGouApp : public QWidget
{
    Q_OBJECT

public:
    KuGouApp(QWidget *parent = nullptr);
    ~KuGouApp();

public slots:
    void setPlayMusic(QUrl url);
    void updateSliderPosition(qint64 position);
    void updateSliderRange(qint64 duration);

private slots:
    void on_basic_toolButton_clicked();

    void on_local_download_toolButton_clicked();

    void on_local_add_toolButton_clicked();

    void on_play_or_pause_toolButton_clicked();

    void on_minimize_toolButton_clicked();

    void on_maximize_toolButton_clicked();

    void on_close_window_toolButton_clicked();

private:
    void InitPosters();
    void InitColumnList();

private:
    Ui::KuGouApp *ui;
    std::unique_ptr<QMediaPlayer> player;
    std::unique_ptr<QAudioOutput> audio_output;
    QMap<int,QUrl> local_music_map;
    bool is_play;

};
#endif // KUGOUAPP_H
